{{:ModuleInclude('public/header')}}

<!-- header top nav -->
{{:ModuleInclude('public/header_top_nav')}}

<!-- header simple nav -->
{{:ModuleInclude('public/header_nav_simple')}}

<!-- 面包屑导航 -->
{{:ModuleInclude('public/breadcrumb_data')}}
<!-- content -->
<div class="am-container user-main am-margin-top-0 am-background-white am-radius-lg">
    <!-- content start -->
    <div class="user-content">
        <div class="user-content-body">
            <h1 class="am-text-xl am-font-weight">{{:MyLang('order.detail_base_nav_title')}}</h1>
            <!-- 用户订单详情状态环节顶部-开始 -->
            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                <div class="plugins-tag">
                    <span>plugins_view_user_order_detail_progress_top</span>
                </div>
            {{/if}}
            {{php}}
                $hook_name = 'plugins_view_user_order_detail_progress_top';
                $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'data'=>$data]);
                if(!empty($hook_data) && is_array($hook_data))
                {
                    foreach($hook_data as $hook)
                    {
                        if(is_string($hook) || is_int($hook))
                        {
                            echo htmlspecialchars_decode($hook);
                        }
                    }
                }
            {{/php}}
            <!-- 用户订单详情状态环节顶部-结束 -->

            <!-- 进度环节 -->
            {{if !empty($step_data)}}
                <ul class="progress progress-{{:count($step_data)}}">
                    {{foreach $step_data as $k=>$v}}
                        <li class="{{if $v['is_check'] eq 1}} steps-success{{/if}} {{if $v['is_current'] eq 1}} current{{/if}}">
                            {{if $k gt 0}}
                                <i class="step"></i>
                            {{/if}}
                            <p class="digital"></p>
                            <div class="base">
                                <p class="title">{{$v.title}}</p>
                                {{if !empty($v['time'])}}
                                    <p class="date am-margin-top-xs">{{$v.time}}</p>
                                {{/if}}
                            </div>
                        </li>
                    {{/foreach}}
                </ul>
            {{/if}}

            <!-- 用户订单详情基础信息顶部-开始 -->
            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                <div class="plugins-tag">
                    <span>plugins_view_user_order_detail_base_top</span>
                </div>
            {{/if}}
            {{php}}
                $hook_name = 'plugins_view_user_order_detail_base_top';
                $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'data'=>$data]);
                if(!empty($hook_data) && is_array($hook_data))
                {
                    foreach($hook_data as $hook)
                    {
                        if(is_string($hook) || is_int($hook))
                        {
                            echo htmlspecialchars_decode($hook);
                        }
                    }
                }
            {{/php}}
            <!-- 用户订单详情基础信息顶部-结束 -->
            <!-- 订单状态 -->
            <div class="order-state">
                <div class="am-panel am-panel-default am-radius">
                    <div class="am-panel-hd">{{:MyLang('order.order_status_title')}}</div>
                    <div class="am-panel-bd">
                        <h1 class="am-text-xl am-font-weight {{if !empty($data['operate_data'])}}{{if $data['operate_data']['is_pay'] eq 1}}am-color-main{{/if}}{{/if}}">{{$data.status_name}}</h1>
                        <div class="items am-cf">
                            <div class="items-title am-fl">{{:MyLang('order.order_base_order_no_title')}}</div>
                            <div class="items-detail am-fl">{{$data.order_no}}</div>
                        </div>

                        <!-- 快递信息、一条快递信息 -->
                        {{if $data['order_model'] eq 0 and in_array($data['status'], [3,4]) and !empty($data.express_data) and is_array($data.express_data) and !empty($data.express_data[0]) and count($data['express_data']) eq 1}}
                            <div class="logistics">
                                <div class="items am-cf">
                                    <div class="items-title am-fl">{{:MyLang('order.form_table_express.name')}}</div>
                                    <div class="items-detail am-fl">
                                        {{if empty($data['express_data'][0]['express_website_url'])}}
                                            {{if !empty($data['express_data'][0]['express_icon'])}}
                                                <img src="{{$data['express_data'][0]['express_icon']}}" class="am-img-thumbnail am-radius am-vertical-align-middle" width="20" height="20" alt="{{$data['express_data'][0]['express_name']}}" />
                                            {{/if}}
                                            <span class="am-vertical-align-middle">{{$data['express_data'][0]['express_name']}}</span>
                                        {{else /}}
                                            <a href="{{$data['express_data'][0]['express_website_url']}}" target="_blank">
                                                {{if !empty($data['express_data'][0]['express_icon'])}}
                                                    <img src="{{$data['express_data'][0]['express_icon']}}" class="am-img-thumbnail am-radius am-vertical-align-middle" width="20" height="20" alt="{{$data['express_data'][0]['express_name']}}" />
                                                {{/if}}
                                                <span class="am-vertical-align-middle">{{$data['express_data'][0]['express_name']}}</span>
                                            </a>
                                        {{/if}}
                                    </div>
                                </div>
                                <div class="items am-cf">
                                    <div class="items-title am-fl">{{:MyLang('order.form_table_express.number')}}</div>
                                    <div class="items-detail am-fl">{{$data['express_data'][0]['express_number']}}</div>
                                </div>
                                {{if !empty($data['express_data'][0]['note'])}}
                                    <div class="items am-cf">
                                        <div class="items-title am-fl">{{:MyLang('order.form_table_express.note')}}</div>
                                        <div class="items-detail am-fl">{{$data['express_data'][0]['note']}}</div>
                                    </div>
                                {{/if}}
                                {{if !empty($data['express_data'][0]['add_time'])}}
                                    <div class="items am-cf">
                                        <div class="items-title am-fl">{{:MyLang('order.form_table_express.time')}}</div>
                                        <div class="items-detail am-fl">{{$data['express_data'][0]['add_time']}}</div>
                                    </div>
                                {{/if}}
                            </div>
                        {{/if}}
                        <!-- 线下支付方式提示信息 -->
                        {{if in_array($data['status'], [1]) and $data['is_under_line'] eq 1}}
                            <div class="am-alert am-alert-warning">
                                <p>{{:MyLang('order.order_under_line_tips', ['payment'=>'<strong class="am-text-success">'.$data['payment_name'].'</strong>'])}}</p>
                            </div>
                        {{/if}}

                        <!-- 待发货提示信息 -->
                        {{if in_array($data['status'], [2])}}
                            <div class="am-alert am-alert-primary">
                                <p>{{:MyLang('order.order_delivery_tips')}}</p>
                            </div>
                        {{/if}}

                        <!-- 订单详情操作顶部钩子 -->
                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                            <div class="plugins-tag">
                                <span>plugins_view_index_order_detail_operate_top</span>
                            </div>
                        {{/if}}
                        {{php}}
                            $hook_name = 'plugins_view_index_order_detail_operate_top';
                            $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'id'=>$data['id'], 'data'=>$data]);
                            if(!empty($hook_data) && is_array($hook_data))
                            {
                                foreach($hook_data as $hook)
                                {
                                    if(is_string($hook) || is_int($hook))
                                    {
                                        echo htmlspecialchars_decode($hook);
                                    }
                                }
                            }
                        {{/php}}

                        <!-- 订单详情操作 -->
                        <div class="operation">
                            <!-- 0待确认, 1已确认/待支付, 2已支付/待发货, 3已发货/待收货, 4已完成, 5已取消, 6已关闭 -->
                            {{if !empty($data['operate_data'])}}
                                {{if $data['operate_data']['is_pay'] eq 1}}
                                    <!-- 去支付 -->
                                    <button class="am-btn am-btn-primary am-btn-sm am-radius submit-pay" data-id="{{$data.id}}" data-payment-id="{{$data.payment_id}}">
                                        {{:MyLang('go_payment_title')}}
                                    </button>
                                {{/if}}
                                {{if $data['operate_data']['is_cancel'] eq 1}}
                                    <!-- 取消 -->
                                    <button type="button" class="am-btn am-btn-primary-plain am-btn-sm am-radius submit-ajax submit-cancel" data-url="{{:MyUrl('index/order/cancel')}}" data-id="{{$data.id}}" data-view="reload">
                                        {{:MyLang('cancel_order_title')}}
                                    </button>
                                {{/if}}
                                {{if $data['operate_data']['is_collect'] eq 1}}
                                    <!-- 确认收货 -->
                                    <button type="button" class="am-btn am-btn-primary am-btn-sm am-radius submit-ajax submit-confirm" data-url="{{:MyUrl('index/order/collect')}}" data-id="{{$data.id}}" data-view="reload" data-msg="{{:MyLang('collect_confirm_tips')}}">
                                        {{:MyLang('confirm_collect_title')}}
                                    </button>
                                {{/if}}
                                {{if $data['operate_data']['is_comments'] eq 1}}
                                    <!-- 评价 -->
                                    <a href="{{:MyUrl('index/order/comments', ['id'=>$data['id']])}}" target="_blank" class="am-btn am-btn-primary-plain am-btn-sm am-radius">
                                        {{:MyLang('go_comment_title')}}
                                    </a>
                                {{/if}}
                                {{if $data['operate_data']['is_delete'] eq 1}}
                                    <!-- 删除订单 -->
                                    <button type="button" class="am-btn am-btn-primary-plain am-btn-sm am-radius submit-delete" data-url="{{:MyUrl('index/order/delete')}}" data-id="{{$data.id}}" data-view="jump" data-value="{{:MyUrl('index/order/index')}}">
                                        {{:MyLang('delete_order_title')}}
                                    </button>
                                {{/if}}
                            {{/if}}
    
                            <!-- 订单详情操作钩子 -->
                            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                                <div class="plugins-tag">
                                    <span>plugins_view_index_order_detail_operate</span>
                                </div>
                            {{/if}}
                            {{php}}
                                $hook_name = 'plugins_view_index_order_detail_operate';
                                $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'id'=>$data['id'], 'data'=>$data]);
                                if(!empty($hook_data) && is_array($hook_data))
                                {
                                    foreach($hook_data as $hook)
                                    {
                                        if(is_string($hook) || is_int($hook))
                                        {
                                            echo htmlspecialchars_decode($hook);
                                        }
                                    }
                                }
                            {{/php}}
                        </div>

                        <!-- 订单详情操作底部钩子 -->
                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                            <div class="plugins-tag">
                                <span>plugins_view_index_order_detail_operate_buttom</span>
                            </div>
                        {{/if}}
                        {{php}}
                            $hook_name = 'plugins_view_index_order_detail_operate_buttom';
                            $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'id'=>$data['id'], 'data'=>$data]);
                            if(!empty($hook_data) && is_array($hook_data))
                            {
                                foreach($hook_data as $hook)
                                {
                                    if(is_string($hook) || is_int($hook))
                                    {
                                        echo htmlspecialchars_decode($hook);
                                    }
                                }
                            }
                        {{/php}}

                        <!-- 自提模式下 - 取货码 -->
                        {{if $data['order_model'] eq 2 and in_array($data['status'], [2,3]) and !empty($data['extraction_data'])}}
                            <div class="extraction-take-container am-inline-block am-background-body am-radius am-text-center am-padding-lg">
                                {{if !empty($data['extraction_data']['images'])}}
                                    <p class="am-margin-bottom-xs">
                                        <img class="qrcode-images am-img-thumbnail am-radius am-block common-annex-view-event" src="{{$data.extraction_data.images}}" alt="{{:MyLang('order.order_base_take_code_title')}}" width="130" height="130" data-is-download="1" />
                                    </p>
                                {{/if}}
                                <p class="am-text-sm">
                                    <span class="am-vertical-align-middle">{{:MyLang('order.order_base_take_code_title')}}</span>
                                    {{if empty($data['extraction_data']['code'])}}
                                        <span class="am-text-danger am-vertical-align-middle">{{:MyLang('order.order_base_take_code_no_exist_tips')}}</span>
                                    {{else /}}
                                        <span class="extraction-take-title am-text-default am-font-weight text-copy-submit am-vertical-align-middle" data-value="{{$data.extraction_data.code}}">{{$data.extraction_data.code}}</span>
                                    {{/if}}
                                </p>
                                {{if !empty($data['extraction_data']['name']) or !empty($data['extraction_data']['tel'])}}
                                    <p class="am-margin-top-xs">
                                        {{if !empty($data['extraction_data']['name'])}}
                                            <span class="text-copy-submit am-margin-right-sm">{{$data.extraction_data.name}}</span>
                                        {{/if}}
                                        {{if !empty($data['extraction_data']['tel'])}}
                                            <span class="text-copy-submit">{{$data.extraction_data.tel}}</span>
                                        {{/if}}
                                    </p>
                                {{/if}}
                            </div>
                        {{/if}}
                    </div>
                </div>
            </div>

            <!-- 订单快递、多条快递信息 -->
            {{if $data['order_model'] eq 0 and in_array($data['status'], [3,4]) and !empty($data.express_data) and is_array($data.express_data) and count($data['express_data']) gt 1}}
                <div class="order-express">
                    <div class="am-panel am-panel-default business-panel">
                        <div class="am-panel-hd">{{:MyLang('common_service.order.delivery_express_info')}}</div>
                        <div class="am-panel-bd">
                            <div class="am-scrollable-horizontal">
                                <table class="am-table am-text-left am-margin-bottom-0  am-text-nowrap">
                                    <thead>
                                        <tr>
                                            <th>{{:MyLang('order.form_table_express.name')}}</th>
                                            <th>{{:MyLang('order.form_table_express.number')}}</th>
                                            <th>{{:MyLang('order.form_table_express.note')}}</th>
                                            <th>{{:MyLang('order.form_table_express.time')}}</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {{foreach $data.express_data as $v}}
                                            <tr class="am-nbfc am-padding-vertical-sm">
                                                <td>
                                                    {{if empty($v['express_website_url'])}}
                                                        {{if !empty($v['express_icon'])}}
                                                            <img src="{{$v.express_icon}}" class="am-img-thumbnail am-radius am-vertical-align-middle" width="20" height="20" alt="{{$v.express_name}}" />
                                                        {{/if}}
                                                        <span class="am-vertical-align-middle">{{$v.express_name}}</span>
                                                    {{else /}}
                                                        <a href="{{$v.express_website_url}}" target="_blank">
                                                            {{if !empty($v['express_icon'])}}
                                                                <img src="{{$v.express_icon}}" class="am-img-thumbnail am-radius am-vertical-align-middle" width="20" height="20" alt="{{$v.express_name}}" />
                                                            {{/if}}
                                                            <span class="am-vertical-align-middle">{{$v.express_name}}</span>
                                                        </a>
                                                    {{/if}}
                                                </td>
                                                <td>
                                                    <span class="text-copy-submit">{{$v.express_number}}</span>
                                                </td>
                                                <td>{{$v.note}}</td>
                                                <td>{{$v.add_time}}</td>
                                            </tr>
                                        {{/foreach}}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            {{/if}}

            <!-- 订单地址 -->
            {{if in_array($data['order_model'], [0, 2]) and !empty($data['address_data'])}}
                <div class="order-address">
                    <div class="am-panel am-panel-default business-panel">
                        <div class="am-panel-hd">{{if $data.order_model eq 2}}{{:MyLang('order.detail_take_title')}}{{else /}}{{:MyLang('order.detail_shipping_address_title')}}{{/if}}</div>
                        <div class="am-panel-bd">
                            <div class="items am-cf">
                                <div class="items-title am-fl">{{if $data['order_model'] eq 2}}{{:MyLang('order.order_contact_title')}}{{else /}} {{:MyLang('order.order_consignee_title')}}{{/if}}：</div>
                                <div class="items-detail am-fl">{{$data.address_data.name}}</div>
                            </div>
                            <div class="items am-cf">
                                <div class="items-title am-fl">{{:MyLang('order.order_phone_title')}}：</div>
                                <div class="items-detail am-fl">{{$data.address_data.tel}}</div>
                            </div>
                            <div class="items am-cf">
                                <div class="items-title am-fl">{{if $data.order_model eq 2}}{{:MyLang('order.detail_take_title')}}{{else /}}{{:MyLang('order.detail_shipping_address_title')}}{{/if}}：</div>
                                <div class="items-detail am-fl">
                                    {{if $data['order_model'] eq 0}}
                                        {{if !empty($data['address_data']['alias'])}}
                                            <span class="am-badge am-badge-primary">{{$data.address_data.alias}}</span>
                                        {{/if}}
                                    {{else /}}
                                        <span class="am-badge am-badge-primary">{{:MyLang('self_pickup_point_title')}}</span>
                                    {{/if}}
                                    <span>{{$data.address_data.province_name}} {{$data.address_data.city_name}} {{$data.address_data.county_name}} {{$data.address_data.address}}</span>
                                    {{if isset($data['address_data']['lng']) and isset($data['address_data']['lat']) and $data['address_data']['lng'] neq 0 and $data['address_data']['lat'] neq 0}}
                                        <button type="button" class="am-btn am-view-map submit-map-popup" data-lng="{{$data.address_data.lng}}" data-lat="{{$data.address_data.lat}}" data-title="{{:MyLang('view_map_title')}}">
                                            {{:MyLang('view_map_title')}}
                                        </button>
                                    {{/if}}
                                </div>
                            </div>
                            {{if !empty($data['address_data']['extraction_contact_name']) or !empty($data['address_data']['extraction_contact_tel']) or !empty($data['address_data']['appoint_time'])}}
                                <hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-vertical-xs">
                                <div class="items am-cf">
                                    {{if !empty($data['address_data']['extraction_contact_name']) or !empty($data['address_data']['extraction_contact_tel'])}}
                                        <div class="items-title am-fl">{{:MyLang('customer_info_title')}}：</div>
                                        <div class="items-detail am-fl">
                                            {{if !empty($data['address_data']['extraction_contact_name'])}}
                                                <span class="text-copy-submit am-margin-right-sm">{{$data.address_data.extraction_contact_name}}</span>
                                            {{/if}}
                                            {{if !empty($data['address_data']['extraction_contact_tel'])}}
                                                <span class="text-copy-submit am-margin-right-sm">{{$data.address_data.extraction_contact_tel}}</span>
                                            {{/if}}
                                        </div>
                                    {{/if}}
                                </div>
                                {{if !empty($data['address_data']['appoint_time'])}}
                                    <div class="items am-cf">
                                        <div class="items-title am-fl">{{:MyLang('appoint_time_title')}}：</div>
                                        <div class="items-detail am-fl">
                                            <span class="text-copy-submit am-color-red">{{$data.address_data.appoint_time}}</span>
                                        </div>
                                    </div>
                                {{/if}}
                            {{/if}}
                        </div>
                    </div>

                    <!-- 用户订单详情地址信息底部-开始 -->
                    {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                        <div class="plugins-tag">
                            <span>plugins_view_user_order_detail_address_bottom</span>
                        </div>
                    {{/if}}
                    {{php}}
                        $hook_name = 'plugins_view_user_order_detail_address_bottom';
                        $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'data'=>$data]);
                        if(!empty($hook_data) && is_array($hook_data))
                        {
                            foreach($hook_data as $hook)
                            {
                                if(is_string($hook) || is_int($hook))
                                {
                                    echo htmlspecialchars_decode($hook);
                                }
                            }
                        }
                    {{/php}}
                    <!-- 用户订单详情地址信息底部-结束 -->
                </div>
            {{/if}}

            <!-- 虚拟销售信息 -->
            {{if $data['order_model'] eq 3 and $data['pay_status'] eq 1 and in_array($data['status'], [3,4])}}
                <div class="order-virtually">
                    <div class="am-panel am-panel-default am-radius business-panel">
                        <div class="am-panel-hd">{{$site_fictitious.title}}</div>
                        <div class="am-panel-bd">
                            {{if !empty($site_fictitious['tips'])}}
                                <div class="am-alert am-alert-warning am-margin-top-xs am-margin-bottom-0 am-margin-horizontal-sm" data-am-alert>
                                    {{$site_fictitious.tips|raw}}
                                </div>
                            {{/if}}
                            {{if !empty($data.items)}}
                                <ul class="am-list am-margin-bottom-0">
                                    {{foreach $data.items as $goods}}
                                        <li class="am-g am-list-item-thumb-left">
                                            <div class="am-list-thumb virtually-left am-radius am-border-grey">
                                                <img src="{{$goods.images}}" alt="{{$goods.title}}" />
                                            </div>
                                            <div class="am-list-item-text richtext virtually-right am-padding-left-xl">
                                                {{if !empty($goods['spec_text'])}}
                                                    <p>
                                                        <strong>{{$goods.spec_text}}</strong>
                                                    </p>
                                                {{/if}}
                                                {{if empty($goods['fictitious_goods_value'])}}
                                                    <span class="am-text-grey am-text-xs">{{:MyLang('no_config_data_tips')}}</span>
                                                {{else /}}
                                                    {{$goods.fictitious_goods_value|raw}}
                                                {{/if}}
                                            </div>
                                        </li>
                                    {{/foreach}}
                                </ul>
                            {{else /}}
                                <div class="table-no">
                                    <i class="am-icon-skyatlas am-icon-lg"></i>
                                    <p>{{:MyLang('order.order_goods_no_data_tips')}}</p>
                                </div>
                            {{/if}}
                        </div>
                    </div>
                </div>
            {{/if}}

            <!-- 用户订单详情虚拟信息底部-开始 -->
            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                <div class="plugins-tag">
                    <span>plugins_view_user_order_detail_fictitious_bottom</span>
                </div>
            {{/if}}
            {{php}}
                $hook_name = 'plugins_view_user_order_detail_fictitious_bottom';
                $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'data'=>$data]);
                if(!empty($hook_data) && is_array($hook_data))
                {
                    foreach($hook_data as $hook)
                    {
                        if(is_string($hook) || is_int($hook))
                        {
                            echo htmlspecialchars_decode($hook);
                        }
                    }
                }
            {{/php}}
            <!-- 用户订单详情虚拟信息底部-结束 -->

            <!-- 订单信息 -->
            <div class="order-info">
                <div class="am-panel am-panel-default am-radius business-panel">
                    <div class="am-panel-hd">{{:MyLang('order.order_base_title')}}</div>
                    <div class="am-panel-bd">
                        {{if !empty($data['warehouse_name'])}}
                            <div class="items am-cf">
                                <div class="items-title am-fl">{{:MyLang('order.order_base_warehouse_title')}}</div>
                                <div class="items-detail am-fl">
                                    <span class="warehouse-item-container">
                                        {{if !empty($data['warehouse_icon'])}}
                                            {{if IsUrl($data['warehouse_icon'])}}
                                                <img src="{{$data.warehouse_icon}}" alt="{{$data.warehouse_name}}" class="warehouse-icon" />
                                            {{else /}}
                                                <i class="{{$data.warehouse_icon}}"></i>
                                            {{/if}}
                                        {{/if}}
                                        {{if empty($data['warehouse_url'])}}
                                            <span class="warehouse-name">{{$data.warehouse_name}}</span>
                                        {{else /}}
                                            <a href="{{$data.warehouse_url}}" target="_blank" class="text-deco-none">
                                                <span class="warehouse-name">{{$data.warehouse_name}}</span>
                                            </a>
                                        {{/if}}
                                    </span>
                                </div>
                            </div>
                        {{/if}}
                        <div class="items am-cf">
                            <div class="items-title am-fl">{{:MyLang('order.order_base_model_title')}}</div>
                            <div class="items-detail am-fl">{{$data.order_model_name}}</div>
                        </div>
                        <div class="items am-cf">
                            <div class="items-title am-fl">{{:MyLang('order.order_base_order_no_title')}}</div>
                            <div class="items-detail am-fl">{{$data.order_no}}</div>
                        </div>
                        {{if !empty($data.status_name)}}
                            <div class="items am-cf">
                                <div class="items-title am-fl">{{:MyLang('order.order_base_status_title')}}</div>
                                <div class="items-detail am-fl">{{$data.status_name}}</div>
                            </div>
                        {{/if}}
                        {{if !empty($data.pay_status_name)}}
                            <div class="items am-cf">
                                <div class="items-title am-fl">{{:MyLang('order.order_base_pay_status_title')}}</div>
                                <div class="items-detail am-fl">{{$data.pay_status_name}}</div>
                            </div>
                        {{/if}}
                        {{if !empty($data.payment_name)}}
                            <div class="items am-cf">
                                <div class="items-title am-fl">{{:MyLang('order.order_base_payment_title')}}</div>
                                <div class="items-detail am-fl">
                                    <span>{{$data.payment_name}}</span>
                                    {{if !empty($data['is_under_line_text'])}}
                                        <span class="am-badge am-badge-danger">{{$data.is_under_line_text}}</span>
                                    {{/if}}
                                </div>
                            </div>
                        {{/if}}
                        {{if !empty($data.total_price)}}
                            <div class="items am-cf">
                                <div class="items-title am-fl">{{:MyLang('order.order_base_total_price_title')}}</div>
                                <div class="items-detail am-fl">{{$data.total_price}}</div>
                            </div>
                        {{/if}}
                        {{if !empty($data.buy_number_count)}}
                            <div class="items am-cf">
                                <div class="items-title am-fl">{{:MyLang('order.order_base_buy_number_title')}}</div>
                                <div class="items-detail am-fl">{{$data.buy_number_count}}</div>
                            </div>
                        {{/if}}
                        {{if !empty($data.returned_quantity)}}
                            <div class="items am-cf">
                                <div class="items-title am-fl">{{:MyLang('order.order_base_returned_quantity_title')}}</div>
                                <div class="items-detail am-fl">{{$data.returned_quantity}}</div>
                            </div>
                        {{/if}}
                        {{if !empty($data.user_note)}}
                            <div class="items am-cf">
                                <div class="items-title am-fl">{{:MyLang('order.order_base_user_note_title')}}</div>
                                <div class="items-detail am-fl">{{$data.user_note}}</div>
                            </div>
                        {{/if}}
                        {{if !empty($data.add_time)}}
                            <div class="items am-cf">
                                <div class="items-title am-fl">{{:MyLang('order.order_base_add_time_title')}}</div>
                                <div class="items-detail am-fl">{{$data.add_time}}</div>
                            </div>
                        {{/if}}
                        {{if !empty($data.confirm_time)}}
                            <div class="items am-cf">
                                <div class="items-title am-fl">{{:MyLang('order.order_base_confirm_time_title')}}</div>
                                <div class="items-detail am-fl">{{$data.confirm_time}}</div>
                            </div>
                        {{/if}}
                        {{if !empty($data.pay_time)}}
                            <div class="items am-cf">
                                <div class="items-title am-fl">{{:MyLang('order.order_base_pay_time_title')}}</div>
                                <div class="items-detail am-fl">{{$data.pay_time}}</div>
                            </div>
                        {{/if}}
                        {{if !empty($data.collect_time)}}
                            <div class="items am-cf">
                                <div class="items-title am-fl">{{:MyLang('order.order_base_collect_time_title')}}</div>
                                <div class="items-detail am-fl">{{$data.collect_time}}</div>
                            </div>
                        {{/if}}
                        {{if !empty($data.user_is_comments_time)}}
                            <div class="items am-cf">
                                <div class="items-title am-fl">{{:MyLang('order.order_base_user_comments_time_title')}}</div>
                                <div class="items-detail am-fl">{{$data.user_is_comments_time}}</div>
                            </div>
                        {{/if}}
                        {{if in_array($data['status'], [5]) and !empty($data['cancel_time'])}}
                            <div class="items am-cf">
                                <div class="items-title am-fl">{{:MyLang('order.order_base_cancel_time_title')}}</div>
                                <div class="items-detail am-fl">{{$data.cancel_time}}</div>
                            </div>
                        {{/if}}
                        {{if in_array($data['status'], [6]) and !empty($data['close_time'])}}
                            <div class="items am-cf">
                                <div class="items-title am-fl">{{:MyLang('order.order_base_close_time_title')}}</div>
                                <div class="items-detail am-fl">{{$data.close_time}}</div>
                            </div>
                        {{/if}}
                    </div>
                </div>
            </div>
            <!-- 用户订单详情基础信息底部-开始 -->
            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                <div class="plugins-tag">
                    <span>plugins_view_user_order_detail_base_bottom</span>
                </div>
            {{/if}}
            {{php}}
                $hook_name = 'plugins_view_user_order_detail_base_bottom';
                $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'data'=>$data]);
                if(!empty($hook_data) && is_array($hook_data))
                {
                    foreach($hook_data as $hook)
                    {
                        if(is_string($hook) || is_int($hook))
                        {
                            echo htmlspecialchars_decode($hook);
                        }
                    }
                }
            {{/php}}
            <!-- 用户订单详情基础信息底部-结束 -->

            <!-- 商品列表 -->
            {{if !empty($data.items)}}
                <div class="order-goods am-text-sm">
                    <table class="am-table am-table-centered">
                        <thead>
                            <tr>
                                <th>{{:MyLang('order.goods_list_thead_base')}}</th>
                                <th class="am-hide-sm-only">{{:MyLang('order.goods_list_thead_price')}}</th>
                                <th class="am-hide-sm-only">{{:MyLang('order.goods_list_thead_number')}}</th>
                                <th class="am-hide-sm-only">{{:MyLang('order.goods_list_thead_total')}}</th>
                            </tr>
                        </thead>
                        <tbody>
                            {{foreach $data.items as $goods}}
                                <tr>
                                    <td>
                                        <div class="goods-shop-info am-text-left">
                                            <a href="{{$goods.goods_url}}" target="_blank" class="am-nbfc am-radius am-border-grey goods-shop-info-left">
                                                <img src="{{$goods.images}}" />
                                            </a>
                                            <div class="goods-shop-info-right am-nbfc ">
                                                <a href="{{$goods.goods_url}}" target="_blank">{{$goods.title}}</a>
                                                {{if ($data['is_can_launch_aftersale'] eq 1 or !empty($goods['orderaftersale'])) and !empty($goods['orderaftersale_btn_text'])}}
                                                    <div class="goods-shop-info-opration">
                                                        <a href="{{:MyUrl('index/orderaftersale/detail', ['oid'=>$data['id'], 'did'=>$goods['id']])}}" target="_blank" class="am-text-primary">
                                                            {{if empty($goods['orderaftersale'])}}
                                                                {{$goods.orderaftersale_btn_text}}
                                                            {{else /}}
                                                                <span class="{{if $goods['orderaftersale']['status'] eq 3}}am-text-success{{else /}}am-text-secondary{{/if}}">{{$goods.orderaftersale_btn_text}}</span>
                                                            {{/if}}
                                                        </a>
                                                    </div>
                                                {{/if}}
                                                {{if !empty($goods.spec_text)}}
                                                    <div class="goods-shop-info-desc am-color-grey am-text-xs">{{$goods.spec_text}}</div>
                                                {{/if}}
                                            </div>
                                        </div>
                                        <div class="wap-base am-show-sm-only am-padding-top-main">
                                            {{if $goods['original_price'] gt 0}}
                                                <span class="original-price am-padding-right-sm">{{$data.currency_data.currency_symbol}}{{$goods.original_price}}</span>
                                            {{/if}}
                                            <span class="price am-padding-right-sm">
                                                <strong>{{$data.currency_data.currency_symbol}}{{$goods.price}}</strong>
                                            </span>
                                            <span class="wap-number am-padding-right-sm">x{{$goods.buy_number}}</span>
                                            {{if isset($goods['returned_quantity']) and $goods['returned_quantity'] gt 0}}
                                                <span class="am-color-yellow am-text-xs">{{:MyLang('already_retreat_title')}} {{$goods.returned_quantity}}</span>
                                            {{/if}}
                                        </div>
                                    </td>
                                    <td class="price am-hide-sm-only">
                                        <p class="line-price">{{$data.currency_data.currency_symbol}}{{$goods.price}}</p>
                                        {{if $goods['original_price'] gt 0}}
                                            <p class="original-price am-text-xs am-color-grey">{{$data.currency_data.currency_symbol}}{{$goods.original_price}}</p>
                                        {{/if}}
                                    </td>
                                    <td class="number am-hide-sm-only">
                                        <span>x{{$goods.buy_number}}</span>
                                        {{if isset($goods['returned_quantity']) and $goods['returned_quantity'] gt 0}}
                                            <span class="am-color-yellow am-text-xs">{{:MyLang('already_retreat_title')}} x{{$goods.returned_quantity}}</span>
                                        {{/if}}
                                    </td>
                                    <td class="price am-hide-sm-only">
                                        <span class="total-price-content am-color-black">{{$data.currency_data.currency_symbol}}{{$goods.total_price}}</span>
                                        {{if isset($goods['refund_price']) and $goods['refund_price'] gt 0}}
                                            <span class="am-color-yellow am-text-xs">{{:MyLang('already_retreat_title')}} x{{$goods.refund_price}}</span>
                                        {{/if}}
                                    </td>
                                </tr>
                            {{/foreach}}
                        </tbody>
                    </table>
                </div>

                <!-- 用户订单详情商品信息底部-开始 -->
                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                    <div class="plugins-tag">
                        <span>plugins_view_user_order_detail_goods_inside_bottom</span>
                    </div>
                {{/if}}
                {{php}}
                    $hook_name = 'plugins_view_user_order_detail_goods_inside_bottom';
                    $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'data'=>$data]);
                    if(!empty($hook_data) && is_array($hook_data))
                    {
                        foreach($hook_data as $hook)
                        {
                            if(is_string($hook) || is_int($hook))
                            {
                                echo htmlspecialchars_decode($hook);
                            }
                        }
                    }
                {{/php}}
                <!-- 用户订单详情商品信息底部-结束 -->

                {{if !empty($data['extension_data'])}}
                    <div class="order-extension">
                        <div class="am-alert am-alert-warning am-radius-sm">
                            {{foreach $data.extension_data as $ertk=>$ext}}
                                <div class="items am-nbfc">
                                    <div class="items-detail">{{$ext.tips}}</div>
                                    <div class="items-title">{{$ext.name}}{{if !empty($ext['tips'])}}：{{/if}}</div>
                                </div>
                            {{/foreach}}
                        </div>
                    </div>
                {{/if}}

                <div class="order-total am-border-bottom-grey">
                  {{if !empty($data.price) and $data.price gt 0}}
                        <div class="items am-cf">
                            <div class="items-detail">{{$data.currency_data.currency_symbol}}{{$data.price}}</div>
                            <div class="items-title">{{:MyLang('order.order_base_price_title')}}</div>
                        </div>
                    {{/if}}
                    {{if !empty($data.increase_price) and $data.increase_price gt 0}}
                        <div class="items am-cf">
                            <div class="items-detail">+{{$data.currency_data.currency_symbol}}{{$data.increase_price}}</div>
                            <div class="items-title">{{:MyLang('order.order_base_increase_price_title')}}</div>
                        </div>
                    {{/if}}
                    {{if !empty($data.preferential_price) and $data.preferential_price gt 0}}
                        <div class="items am-cf">
                            <div class="items-detail am-color-yellow">-{{$data.currency_data.currency_symbol}}{{$data.preferential_price}}</div>
                            <div class="items-title">{{:MyLang('order.order_base_preferential_price_title')}}</div>
                        </div>
                    {{/if}}
                    {{if !empty($data.refund_price) and $data.refund_price gt 0}}
                        <div class="items am-cf">
                            <div class="items-detail am-color-yellow">-{{$data.currency_data.currency_symbol}}{{$data.refund_price}}</div>
                            <div class="items-title">{{:MyLang('order.order_base_refund_price_title')}}</div>
                        </div>
                    {{/if}}
                    {{if !empty($data.pay_price) and $data.pay_price gt 0}}
                        <div class="items am-cf">
                            <div class="items-detail">{{$data.currency_data.currency_symbol}}{{$data.pay_price}}</div>
                            <div class="items-title">{{:MyLang('order.order_base_pay_price_title')}}</div>
                        </div>
                    {{/if}}
                    {{if !empty($data.total_price)}}
                        <div class="items am-cf">
                            <div class="items-detail line-price am-color-main am-text-lg am-font-weight">{{$data.currency_data.currency_symbol}}{{$data.total_price}}</div>
                            <div class="items-title am-color-main">{{:MyLang('order.order_base_total_price_title')}}</div>
                        </div>
                    {{/if}}
                </div>
            {{/if}}

            <!-- 用户订单详情商品信息底部-开始 -->
            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                <div class="plugins-tag">
                    <span>plugins_view_user_order_detail_goods_bottom</span>
                </div>
            {{/if}}
            {{php}}
                $hook_name = 'plugins_view_user_order_detail_goods_bottom';
                $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'data'=>$data]);
                if(!empty($hook_data) && is_array($hook_data))
                {
                    foreach($hook_data as $hook)
                    {
                        if(is_string($hook) || is_int($hook))
                        {
                            echo htmlspecialchars_decode($hook);
                        }
                    }
                }
            {{/php}}
            <!-- 用户订单详情商品信息底部-结束 -->
        </div>

        <!-- 支付弹窗 -->
        {{:ModuleInclude('order/payment_popup')}}
    </div>
    <!-- content end -->
</div>

<!-- footer start -->
{{:ModuleInclude('public/footer')}}